<template>
  <!-- 机票列表历史记录组件(侧边栏) -->
  <div class="aside">
    <div class="statement">
      <el-row type="flex" justify="space-between" class="statement-list">
        <el-col :span="8">
          <i class="iconfont iconweibiaoti-_huabanfuben" style="color:#409eff"></i>
          <span>航协认证</span>
        </el-col>
        <el-col :span="8">
          <i class="iconfont iconbaozheng" style="color:green"></i>
          <span>出行保证</span>
        </el-col>
        <el-col :span="8">
          <i class="iconfont icondianhua" style="color:#409eff"></i>
          <span>7x242</span>
        </el-col>
      </el-row>
      <p class="service-tel">免费客服电话：4006345678转2</p>
    </div>

    <div class="history">
      <h5>历史查询</h5>
      <nuxt-link
        @click.native="handleHistory"
        :to="`/air/flights?departCity=${item.departCity}&departCode=CAN&destCity=${item.destCity}&destCode=SHA&departDate=${item.departDate}`"
        v-for="(item,index) in $store.state.history.historys"
        :key="index"
      >
        <el-row class="history-item" type="flex" align="middle" justify="space-between">
          <div class="air-info">
            <div class="to-from">{{item.departCity}} - {{item.destCity}}</div>
            <p>{{item.departDate}}</p>
          </div>
          <span>选择</span>
        </el-row>
      </nuxt-link>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    //历史记录点击事件
    handleHistory() {
      console.log("历史记录");
    }
  }
};
</script>

<style lang="less" scoped>
.aside {
  .statement {
    border: 1px solid #ddd;
    .statement-list {
      padding: 10px 0;
      > div {
        text-align: center;
        //字体图标
        i {
          display: block;
          font-size: 40px;
        }
        span {
          font-size: 12px;
        }
      }
    }
    //客服电话
    .service-tel {
      padding: 0 10px;
      height: 32px;
      line-height: 32px;
      font-size: 14px;
      background: #f6f6f6;
    }
  }
  //2.历史查询
  .history {
    padding: 0 10px;
    margin-top: 10px;
    border: 1px solid #ddd;
    h5 {
      font-size: 16px;
      padding-bottom: 10px;
      font-weight: normal;
      border-bottom: 1px solid #ddd;
    }
    a {
      display: block;
      padding-top: 8px;
      border-bottom: 1px solid #eee;
      color: #000;
      text-decoration: none;

      &:last-child {
        border: none;
      }
    }
    .history-item {
      padding: 10px 0;
      font-size: 14px;
      border-bottom: 1px solid #eee;
      &:first-child {
        border: none;
      }

      .to-from {
        margin-bottom: 5px;
      }
      p {
        font-size: 12px;
        color: #000;
      }

      span {
        display: block;
        padding: 2px 10px;
        color: #fff;
        background: #ffa500;
        border-radius: 4px;
        font-size: 12px;
        cursor: pointer;
      }
    }
  }
}
</style>